package com.ruoyi.bizsys.service.impl;

import java.util.List;
import java.util.Arrays;

import com.alibaba.fastjson.JSONObject;
import com.ruoyi.bizsys.domain.*;
import com.ruoyi.bizsys.service.*;
import com.ruoyi.common.config.EmailConfig;
import com.ruoyi.common.constant.Constants;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.vo.EmailVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.bizsys.mapper.CustAndonLogMapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;


/**
 * 客户反馈AndonService业务层处理
 *
 * @author african-loan
 * @date 2022-01-05
 */
@Service
public class CustAndonLogServiceImpl extends ServiceImpl<CustAndonLogMapper, CustAndonLog> implements ICustAndonLogService {


    @Autowired
    ILoanOrderService iLoanOrderService;

    @Autowired
    ICreditApplyService iCreditApplyService;

    @Autowired
    IRealNameAuthService iRealNameAuthService;

    @Autowired
    ICustBindCardLogService iCustBindCardLogService;

    @Autowired
    IAppUserService iAppUserService;


    /**
     * 查询客户反馈Andon
     *
     * @param id 客户反馈AndonID
     * @return 客户反馈Andon
     */
    @Override
    public CustAndonLog selectCustAndonLogById(Long id) {
        return this.getById(id);
    }

    /**
     * 查询客户反馈Andon列表
     *
     * @param custAndonLog 客户反馈Andon
     * @return 客户反馈Andon
     */
    @Override
    public List<CustAndonLog> selectCustAndonLogList(CustAndonLog custAndonLog) {
        return this.list(new QueryWrapper<>(custAndonLog).last("order by id desc"));
    }

    /**
     * 新增客户反馈Andon
     *
     * @param custAndonLog 客户反馈Andon
     * @return 结果
     */
    @Override
    public int insertCustAndonLog(CustAndonLog custAndonLog) {
        return baseMapper.insert(custAndonLog);
    }

    /**
     * 修改客户反馈Andon
     *
     * @param custAndonLog 客户反馈Andon
     * @return 结果
     */
    @Override
    public int updateCustAndonLog(CustAndonLog custAndonLog) {
        custAndonLog.setUpdateTime(DateUtils.getNowDate());
        return baseMapper.updateById(custAndonLog);
    }

    /**
     * 批量删除客户反馈Andon
     *
     * @param ids 需要删除的客户反馈AndonID
     * @return 结果
     */
    @Override
    public int deleteCustAndonLogByIds(Long[] ids) {
        return baseMapper.deleteBatchIds(Arrays.asList(ids));
    }

    /**
     * 删除客户反馈Andon信息
     *
     * @param id 客户反馈AndonID
     * @return 结果
     */
    @Override
    public int deleteCustAndonLogById(Long id) {
        return baseMapper.deleteById(id);
    }

}
